<template>
  <div class="marketing">
    <div class="swiper-container" id="swiperban2" style="width: 1550px">
      <div class="swiper-wrapper">
        <div
          class="swiper-slide slides"
          v-for="(item, index) in product"
          :key="item.id"
        >
          <div :class="'slide_item ' + 'slide' + index">
            <div class="slitop">
              <!-- :style="'background-image:url(' + item.bgurl + ')'" -->
              <div class="topimg">
                <img :src="item.bgurl" alt="" />
              </div>
              <div class="midd">
                <img :src="item.neibgurl" />
              </div>
            </div>
            <div class="slibot">
              <h3>{{ item.title }}</h3>
              <p>
                {{ item.content }}
              </p>
              <el-button class="slibtn">
                <!-- :to="{path:'/test',query: {name: id}}"  /projectCase?name='132' -->
                <router-link
                  :to="{ path: '/projectCase', query: { id: item.id } }"
                  >访问觅食互动</router-link
                >
                <!-- <a href="">访问觅食互动</a> -->
              </el-button>
            </div>
          </div>
        </div>
      </div>
      <div class="swiper-pagination pagecla"></div>
      <!-- pagecla -->
    </div>
  </div>
</template>

<script>
import Swiper from "swiper";
export default {
  props: ["product"],
  data() {
    return {
      swiper: null
    }
  },

  methods: {
    swiperFun() {
      this.swiper = new Swiper('#swiperban2', {
        loop: true,
        slidesPerView: 3,
        spaceBetween: 30,
        setWrapperSize: true,
        pagination: {
          el: '.swiper-pagination',
          type: 'bullets',
        },
      });
    }
  },
  mounted() {
    this.swiperFun()

  }
}
</script>

<style scoped lang="scss">
.marketing {
  width: 1550px;
  margin: 0 auto;
  // border: 1px solid red;
  // min-height: 940px;
  position: relative;
  #swiperban2 {
    // height: auto;
    position: relative;
    height: 100%;
  }
  .pagecla {
    bottom: 0;
    top: 0;
    position: relative;
    z-index: 800;
    margin-top: 60px;
  }

  .other {
    margin-top: 60px;
    font-size: 15px;
    p {
      font-size: 15px;
      text-align: center;
      span {
        color: #0054f7;
      }
    }
  }
}
.marketing .slides {
  width: 490px;
  // max-width: 490px;
  // min-width: 490px;
  height: 672px;
  box-shadow: 0px 20px 20px 0px rgba(0, 0, 0, 0.03);
  border-radius: 10px;
  overflow: hidden;
}
.marketing .slides .slide_item {
  width: 100%;
  height: 100%;
  box-shadow: 0px 20px 20px 0px rgba(0, 0, 0, 0.03);
  border-radius: 10px;
  background: #fff;
  .slitop {
    width: 100%;
    height: 276px;
    background-position: 0 0;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    position: relative;
    background-position: center;
    transition: background-size 0.5;
    .midd {
      width: 90px;
      height: 90px;
      position: absolute;
      bottom: -45px;
      left: 0;
      right: 0;
      margin: 0 auto;
      background: #fff;
      box-shadow: 0px 20px 20px 0px rgba(0, 0, 0, 0.02);
      border-radius: 10px;
      text-align: center;
      vertical-align: middle;
      line-height: 90px;
      img {
        vertical-align: middle;
        width: 32px;
        height: 32px;
      }
    }
    .topimg {
      width: 100%;
      height: 100%;
      overflow: hidden;
      img{
        width: 100%;
        height: 100%;
        transition: all 0.5s;
      }
    }
  }
  .slibot {
    background: #fff;
    width: 100%;
    text-align: center;
    h3 {
      text-align: center;
      font-size: 24px;
      font-weight: 600;
      color: rgba(0, 0, 0, 0.85);
      width: 216px;
      text-overflow: ellipsis;
      overflow: hidden;
      white-space: nowrap;
      margin: 0 auto;
      margin-top: 80px;
      margin-bottom: 25px;
    }
    p {
      text-align: center;
      // height: 35px;
      line-height: 35px;
      max-width: 360px;
      margin: 0 auto;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .slibtn {
      width: 355px;
      height: 60px;
      // background: #ffffff;
      border-radius: 10px;
      // border: 1px solid #d6d5d5;
      margin: 47px auto;
      line-height: 34px;
      a {
        display: inline-block;
        width: 100%;
        height: 100%;
        font-weight: 500;
        text-align: center;
        color: rgba(0, 0, 0, 0.85);
        font-size: 17px;
      }
    }
  }
}
.marketing .slides .slide_item:hover {
  .topimg img{
    transform: scale(1.1)!important;
  }
}

.marketing .slide1 {
  background: #fff;
}
.marketing .slide2 {
  background: darkblue;
}
.marketing .slide3 {
  background: sandybrown;
}
</style>